layui.use('table', function() {
	var table = layui.table,layer=layui.layer;
	
	table.on('checkbox(table)', function(obj){
		var checkStatus = table.checkStatus('idTest'),data = checkStatus.data;
         if(data.length>0){
         	$(".center-nav a.hb-bnt").removeClass("hov-n").addClass("hov");
         }else{
         	$(".center-nav a.hb-bnt").removeClass("hov").addClass("hov-n");
         }
     });
	var $ = layui.$, active = {
	 	handle: function(){
	      var checkStatus = table.checkStatus('idTest'),data = checkStatus.data;
	      var stx=$(this).attr("data-st");
	      var myArray = new Array();
			for(var i = 0; i < data.length; i++) {
				myArray.push(data[i].id)
			}
			
			if(stx==1){
				var tsTxet="您确定要通过审核"
				var icon=1
			}else{
				var tsTxet='您确定要驳回审核'
				var icon=2
			}
			
			layer.alert(tsTxet, {
				icon: icon,
				btn: ['确定', '关闭'],
				btn1: function() {
					$.ajax({
						type: 'post',
						dataType: 'json',
						url: czSrc,
						data: {
							id:myArray,
							status:stx,
							token:token
						},
						success: function(data) {
							var code = data.code;
							var msg = data.msg;
							if(code == 1) {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 1
								}, function() {
									location.reload();
								})
							} else {
								layer.close(layer.index)
								layer.alert(msg, {
									icon: 5
								})
							}
						}
					})
				}
			})
	    }
	 }
	 $('.right-center .right-btn').on('click', function(){
	    var type = $(this).data('type');
	    active[type] ? active[type].call(this) : '';
	});
	
	layer.msg('数据加载中...', {
		icon: 16,
		shade: 0.3,
		success: function() {
			$.ajax({
				type: 'post',
				dataType: 'json',
				url: listSrc,
				data:seet,
				success: function(data) {
					table.render({
						elem: '#centet-cen',
						height: $(".center-tab").height(),
						id:'idTest',
						cols: [
							[ //标题栏
							    {
									type: 'checkbox'
								},{
									field: 'id',
									title: '交易编号',
									width: 100
								}, {
									field: 'mid',
									title: '会员编号',
									width: 100
								}, {
									field: 'coin_name',
									title: '货币',
									width: 100
								}, {
									field: 'amount',
									title: '提现金额',
									width: 100
								}, {
									field: 'bank_name',
									title: '银行名称',
									width: 160
								}, {
									field: 'bank_card',
									title: '银行卡号'
								}, {
									field: 'owner',
									title: '开户人',
									width: 100
								}, {
									field: 'bank_address',
									title: '银行地址'
								}, {
									field: 'create_time',
									title: '申请时间',
									width: 160
								}, {
									field: 'status_remark',
									title: '状态',
									width: 100
								}

							]
						],
						data: data.data,
						limit: 200
					});
					var pageHtml = data.page_html;
					$(".paging").html(pageHtml);
					layer.close(layer.index)
				}
			});
		}
	});
	
	
	
})

layui.use(['form', 'layedit', 'laydate'], function(){
	 var form = layui.form,layer = layui.layer,layedit = layui.layedit,laydate = layui.laydate;
	laydate.render({
		elem: '#start'
	});
	laydate.render({
		elem: '#end'
	});
})



$(function(){
    $('#screen-form').formEdit(seet);
	
	
	$("#Expbnt").click(function(){
		$("#screen-form").attr("action",ExpSrc);
	})
	
	
	$("#ScreenBnt").click(function(){
		$("#screen-form").attr("action",'');
	})
	
	
	
})